$(function(){
		 
	initPage();
});

//初始化页面配置
function initPage(){
	
	//获取上个页面的传参
	var storeName = decodeURI(getQueryStr("storeName"));
	var storeAddress = decodeURI(getQueryStr("storeAddress"));
	var storeTel = getQueryStr("storeTel");
	var longitude = parseFloat(getQueryStr("longitude"));
	var latitude = parseFloat(getQueryStr("latitude"));
	
	//初始化地图和坐标
	initMap(longitude,latitude);
	
	//初始化店名，电话，地址
	$(".title").html(storeName);
	$(".address").html(storeAddress);
	$(".telphone").html(storeTel);
}

/**
 * 初始化地图和坐标
 * @param {Object} storeLongitude 经度
 * @param {Object} storeLatitude 纬度
 */
function initMap(storeLongitude,storeLatitude)
{
	var map = new AMap.Map("map", {
        resizeEnable: true,
        center: [storeLongitude, storeLatitude],
        zoom: 18
    });
    
    var marker = new AMap.Marker({
        icon: "http://webapi.amap.com/theme/v1.3/markers/n/mark_b.png",
        position: [storeLongitude, storeLatitude]
    });
    
    marker.setMap(map);
    
    $("a[class='amap-logo']").attr("href","javascript:void(0);");
    $("a[class='amap-logo']").removeAttr("target");
}

//自动适配屏幕
function autoMax()
{
	var width = document.body.clientWidth;
	var beishu = width/375;  ////375 iphone6屏幕上的标准
	
	$("html").css('font-size',$("html").css('font-size')*beishu);
	var fz = 10*beishu;
	$("html").css('font-size',fz);
	
}